package cn.gson.crm.controller;

import cn.gson.crm.model.pojos.CustomerService;
import cn.gson.crm.model.pojos.Questions;
import cn.gson.crm.model.service.QuestionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Controller
@RequestMapping("/QuestionsController")
public class QuestionsController {
    @Autowired
    QuestionsService questionsService;
    @RequestMapping("/ContractMethod")
    @ResponseBody
    public Map<String,Object> selectcom( Integer page, Integer size){

        return questionsService.selectcom(page,size);
    };
    //条件查询
    @RequestMapping("/ContractMethod1")
    @ResponseBody
    public Map<String,Object> selectwhere( String where,Integer page, Integer size){

        return questionsService.selectwhere(where,page,size);
    };
    //根据时间查询
    @RequestMapping("/ContractMethod2")
    @ResponseBody
    public Map<String,Object> selecttime(  String statr, String endtime,Integer page, Integer size){
        return questionsService.selecttime(statr,endtime,page,size);
    };
    //新增
    @RequestMapping("/ContractMethod3")
    @ResponseBody
    public void  savecom(@RequestBody Questions questions){
        questionsService.savecom(questions);
    }
    //删除
    @RequestMapping("/ContractMethod4")
    @ResponseBody
    public void deletCustomerService(@RequestBody Questions questions){
        questionsService.deletCustomerService(questions);
    }
}
